/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/


%module (docstring="Fulguro Linear Processing Module") flgrlinear

%include ../common/common.i

 /*********************** Include for wrapper **********************/

%inline %{

#include <flgrCoreTypes.h>
#include <flgrCoreErrors.h>
#include <flgrCoreVector.h>
#include <flgrCoreData.h>
#include <flgrLinearFFT.h>
#include "flgrLinearGabor.h"
#include "flgrLinearGaussian.h"
#include "flgrLinearConvolution.h"

  %}


%feature("autodoc","""
[out] Destination vector (FLGR_Vector)
[in] Neighborhood container box (FLGR_NhbBox1D)
[return] FLGR_Ret\n 
Compute convolution operation on one neighborhood
""") flgr1d_get_nhb_convolution;
FLGR_Ret flgr1d_get_nhb_convolution(FLGR_Vector *result, FLGR_NhbBox1D *extr);

%feature("autodoc","""
[out] Destination vector (FLGR_Vector)
[in] Neighborhood container box (FLGR_NhbBox2D)
[return] FLGR_Ret\n 
Compute convolution operation on one neighborhood
""") flgr2d_get_nhb_convolution;
FLGR_Ret flgr2d_get_nhb_convolution(FLGR_Vector *result, FLGR_NhbBox2D *extr);






%include ../common/typemap_flgr_vector.i









%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[in] nhb definition (FLGR_Data1D)
[return] FLGR_Ret\n 
Compute convolution
""") flgr1d_convolution;
FLGR_Ret flgr1d_convolution(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb);

%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[in] nhb definition (FLGR_Data1D)
[return] FLGR_Ret\n 
Compute convolution unfolded
""") flgr1d_convolution_unfolded;
FLGR_Ret flgr1d_convolution_unfolded(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb);

%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[return] FLGR_Ret\n 
Complex forward fast Fourier transform
""") flgr1d_fft_forward_cplx;
FLGR_Ret flgr1d_fft_forward_cplx(FLGR_Data1D *datfft, FLGR_Data1D *datsrc);

%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[return] FLGR_Ret\n 
Complex backward fast Fourier transform
""") flgr1d_fft_backward_cplx;
FLGR_Ret flgr1d_fft_backward_cplx(FLGR_Data1D *datdest, FLGR_Data1D *datfft);

%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[return] FLGR_Ret\n 
Real forward fast Fourier transform
""") flgr1d_fft_forward_cplx;
FLGR_Ret flgr1d_fft_forward_real(FLGR_Data1D *datfft, FLGR_Data1D *datsrc);

%feature("autodoc","""
[out] Destination signal (FLGR_Data1D)
[in] source signal (FLGR_Data1D)
[return] FLGR_Ret\n 
Real backward fast Fourier transform
""") flgr1d_fft_backward_real;
FLGR_Ret flgr1d_fft_backward_real(FLGR_Data1D *datdest, FLGR_Data1D *datfft);

%feature("autodoc","""
[out] Destination neighborhood 1d definition (FLGR_Data1D)
[in] sigma (Float)
[in] level max (Float)
[return] FLGR_Ret\n 
Set nhb with a gaussian
""") flgr1d_set_gaussian_kernel;
FLGR_Ret flgr1d_set_gaussian_kernel(FLGR_Data1D *nhb, fgFLOAT64 sigma, fgFLOAT64 levelMax);

%feature("autodoc","""
[out] Destination neighborhood 1d definition (FLGR_Data1D)
[in] lambda (Float)    : wavelength of the cosine factor of the gabor funtion
[in] theta (Float)     : orientation of the normal parallel stripes of the gabor function (rad)
[in] phi (Float)       : phase offset of the cosine factor of the gabor function (rad)
[in] gamma (Float)     : ellipticity of the gabor factor (generally 0.2 < gamma < 1)
[in] bandwidth (Float) : spatial frequency bandwidth of the filter (generally 0.4 < bdwdth < 2.5)
[in] offset (Float)    : offset to apply to gabor function (apply before amplitude)
[in] amplitude (Float) : amplitude to apply to gabor function
[return] FLGR_Ret\n 
Set nhb with a gabor
""") flgr1d_set_gabor_kernel;
FLGR_Ret flgr1d_set_gabor_kernel(FLGR_Data1D *nhb, fgFLOAT64 lambda, 
				 fgFLOAT64 theta, fgFLOAT64 phi,
				 fgFLOAT64 gamma, fgFLOAT64 bandwidth, 
				 fgFLOAT64 offset, fgFLOAT64 amplitude);










%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[in] nhb definition (FLGR_Data2D)
[return] FLGR_Ret\n 
Compute convolution
""") flgr2d_convolution;
FLGR_Ret flgr2d_convolution(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb);

%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[in] nhb definition (FLGR_Data2D)
[return] FLGR_Ret\n 
Compute convolution unfolded
""") flgr2d_convolution_unfolded;
FLGR_Ret flgr2d_convolution_unfolded(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb);

%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[return] FLGR_Ret\n 
Complex forward fast Fourier transform
""") flgr2d_fft_forward_cplx;
FLGR_Ret flgr2d_fft_forward_cplx(FLGR_Data2D *datfft, FLGR_Data2D *datsrc);

%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[return] FLGR_Ret\n 
Complex backward fast Fourier transform
""") flgr2d_fft_backward_cplx;
FLGR_Ret flgr2d_fft_backward_cplx(FLGR_Data2D *datdest, FLGR_Data2D *datfft);

%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[return] FLGR_Ret\n 
Real forward fast Fourier transform
""") flgr2d_fft_forward_cplx;
FLGR_Ret flgr2d_fft_forward_real(FLGR_Data2D *datfft, FLGR_Data2D *datsrc);

%feature("autodoc","""
[out] Destination signal (FLGR_Data2D)
[in] source signal (FLGR_Data2D)
[return] FLGR_Ret\n 
Real backward fast Fourier transform
""") flgr2d_fft_backward_real;
FLGR_Ret flgr2d_fft_backward_real(FLGR_Data2D *datdest, FLGR_Data2D *datfft);

%feature("autodoc","""
[out] Destination neighborhood 2d definition (FLGR_Data2D)
[in] sigma (Float)
[in] level max (Float)
[return] FLGR_Ret\n 
Set nhb with a gaussian
""") flgr2d_set_gaussian_kernel;
FLGR_Ret flgr2d_set_gaussian_kernel(FLGR_Data2D *nhb, fgFLOAT64 sigma, fgFLOAT64 levelMax);

%feature("autodoc","""
[out] Destination neighborhood 2d definition (FLGR_Data2D)
[in] lambda (Float)    : wavelength of the cosine factor of the gabor funtion
[in] theta (Float)     : orientation of the normal parallel stripes of the gabor function (rad)
[in] phi (Float)       : phase offset of the cosine factor of the gabor function (rad)
[in] gamma (Float)     : ellipticity of the gabor factor (generally 0.2 < gamma < 1)
[in] bandwidth (Float) : spatial frequency bandwidth of the filter (generally 0.4 < bdwdth < 2.5)
[in] offset (Float)    : offset to apply to gabor function (apply before amplitude)
[in] amplitude (Float) : amplitude to apply to gabor function
[return] FLGR_Ret\n 
Set nhb with a gabor
""") flgr2d_set_gabor_kernel;
FLGR_Ret flgr2d_set_gabor_kernel(FLGR_Data2D *nhb, fgFLOAT64 lambda, 
				 fgFLOAT64 theta, fgFLOAT64 phi,
				 fgFLOAT64 gamma, fgFLOAT64 bandwidth, 
				 fgFLOAT64 offset, fgFLOAT64 amplitude);





